package cz.fit.vutbr.pis2012.augeaswh.control.ekonom.subscriber;

import java.io.Serializable;
import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import cz.fit.vutbr.pis2012.augeaswh.managers.SubscriberManager;
import cz.fit.vutbr.pis2012.augeaswh.persistence.Subscriber;

@ManagedBean
@SessionScoped
public class SubscriberBean implements Serializable {

	private static final long serialVersionUID = 6623360402202691962L;
	@EJB
	private SubscriberManager sm;
	private int page;
	private final int recordsPerPage;
	private Subscriber currentSupplier;

	public SubscriberBean() {
		this.page = 1;
		this.recordsPerPage = 15;
		this.currentSupplier = null;
	}

	public List<Subscriber> getSubscribers() {
		return sm.getSubscribers();
	}

	public String editSubscriber() {
		return "edit";
	}
	
	public int getPage() {
		return this.page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRecordsPerPage() {
		return this.recordsPerPage;
	}

	public Subscriber getCurrentSupplier() {
		return currentSupplier;
	}

	public void setCurrentSupplier(Subscriber currentSupplier) {
		this.currentSupplier = currentSupplier;
	}

}
